#!/bin/bash -ex

workspace=$(pwd)

docker run --name centos-local-yum-env -d --rm \
-v ${workspace}/repo:/data/repo \
-v ${workspace}/CentOS-Local.repo:/etc/yum.repos.d/CentOS-Local.repo \
centos:centos7 tail -f /dev/null

docker exec centos-local-yum-env /bin/bash -c "yum clean all && yum makecache"
docker exec -it centos-local-yum-env bash

docker rm -f centos-local-yum-env
